<?php
namespace Api\Controller;
use Think\Controller\HproseController;

class UserController extends HproseController{
    
   
    
    public function test(){
        return "ssssss";
    }
    
    public function login($username,$password){
        if(!$username){
            $error=-1;
        }
        if(!$password){
            $error=-2;
        }
       
        $user_object = D('User');
        $map['group'] = array('egt', 1); //后台部门
        $uid = $user_object->login($username, $password,$map);
        if(0 < $uid){
            return $uid;
        }else{
            return $error;
        }
    }
}